package com.nervenets.web.hibernate.domain.user;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserRole implements Serializable {
    private boolean admin = false;
    private boolean issue = false;
    private boolean market = false;
    private boolean dealer = false;
    private boolean user = true;

    public String toJSONString() {
        return JSON.toJSONString(this);
    }

    public static UserRole admin() {
        return new UserRole(true, false, false, false, true);
    }
}
